<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="created" content="2018-10-23T06:18:10.521000000">
    <meta name="changed" content="2020-06-26T10:59:00.126200000">
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="en">
    <title>
      Adder
    </title>
    <link rel="stylesheet" type="text/css" href="../../style.css">
  </head>
  <body>
    <div class="maindiv">
      <h1>
        <img class="iconlibs" src="../../../../icons/6464/adder.png" alt="#########" width="32" height="32" align="middle"> <em>Adder</em>
      </h1>
      <table>
        <tbody>
          <tr>
            <td>
              <strong>Library:</strong>
            </td>
            <td>
              <a href="index.html">Arithmetic</a>
            </td>
          </tr>
          <tr>
            <td>
              <strong>Introduced:</strong>
            </td>
            <td>
              2.0 Beta 11
            </td>
          </tr>
          <tr>
            <td valign="top">
              <strong>Appearance:</strong>
            </td>
            <td valign="top">
              <img class="appearancelibs" src="../../../../img-libs/adder.png" alt="#########" width="64" height="64">
            </td>
          </tr>
        </tbody>
      </table>
      <h2>
        Behavior
      </h2>
      <p>
        This component adds two values coming in via the west inputs and outputs the sum on the east output. The component is designed so that it can be cascaded with other adders to provide add more bits than is possible with a single adder: The carry-in input provides a one-bit value to be added into the sum also (if it is specified), and a carry-out output provides a one-bit overflow value that can be fed to another adder.
      </p>
      <p>
        If either of the addends contains some floating bits or some error bits, then the component will perform a partial addition. That is, it will compute as many low-order bits as possible. But above the floating or error bit, the result will have floating or error bits.
      </p>
      <h2>
        Pins
      </h2>
      <dl>
        <dt>
          West edge, north end (input, bit width matches Data Bits attribute)
        </dt>
        <dd>
          One of the two values to add.
        </dd>
        <dt>
          West edge, south end (input, bit width matches Data Bits attribute)
        </dt>
        <dd>
          The other of the two values to add.
        </dd>
        <dt>
          North edge, labeled <var>c in</var> (input, bit width 1)
        </dt>
        <dd>
          A carry value to add into the sum. If the value is unknown (i.e., floating), then it is assumed to be 0.
        </dd>
        <dt>
          East edge (output, bit width matches Data Bits attribute)
        </dt>
        <dd>
          The lower <var>dataBits</var> bits of the sum of the two values coming in the west edge, plus the <var>c</var><sub><var>in</var></sub> bit.
        </dd>
        <dt>
          South edge, labeled <var>c out</var> (output, bit width 1)
        </dt>
        <dd>
          The carry bit computed for the sum. If the values added together as unsigned values yield a result that fits into <var>dataBits</var> bits, then this bit will be 0; otherwise, it will be 1.
        </dd>
      </dl>
      <h2>
        Attributes
      </h2>
      <p>
        When the component is selected or being added, <b class="tkeybd">Alt-0</b> throught <b class="tkeybd">Alt-9</b> alter its <b class="propertie">Data Bits</b> attribute.
      </p>
	  <div class="attliste">
      <dl>
        <dt>
          <b class="propertie">Data Bits</b>
        </dt>
        <dd>
          The bit width of the values to be added and of the result.
        </dd>
      </dl>
	  </div>
      <h2>
        Poke Tool Behavior
      </h2>
      <p>
        None.
      </p>
      <h2>
        Text Tool Behavior
      </h2>
      <p>
        None.
      </p>
      <p>
        <b>Back to</b> <a href="../index.html">Library Reference</a>
      </p>
    </div>
  </body>
</html>
